package com.jf.cloud.user.service.impl;

import com.jf.cloud.common.database.dto.PageDTO;
import com.jf.cloud.common.database.util.PageUtil;
import com.jf.cloud.common.database.vo.PageVO;
import com.jf.cloud.user.dto.UserTravelsLikeDTO;
import com.jf.cloud.user.model.UserTravelsLike;
import com.jf.cloud.user.mapper.UserTravelsLikeMapper;
import com.jf.cloud.user.service.UserTravelsLikeService;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 
 *
 * @author zz
 * @date 2023-11-10 17:18:48
 */
@Service
public class UserTravelsLikeServiceImpl implements UserTravelsLikeService {

    @Autowired
    private UserTravelsLikeMapper userTravelsLikeMapper;

    @Override
    public PageVO<UserTravelsLike> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> userTravelsLikeMapper.list());
    }

    @Override
    public int count(UserTravelsLikeDTO userTravelsLikeDTO) {
        return userTravelsLikeMapper.count(userTravelsLikeDTO);
    }

    @Override
    public UserTravelsLike getById(Long id) {
        return userTravelsLikeMapper.getById(id);
    }

    @Override
    public List<UserTravelsLike> getByUserId(UserTravelsLikeDTO userTravelsLikeDTO) {
        return userTravelsLikeMapper.getByUserId(userTravelsLikeDTO);
    }

    @Override
    public void save(UserTravelsLike userTravelsLike) {
        userTravelsLikeMapper.save(userTravelsLike);
    }

    @Override
    public void update(UserTravelsLike userTravelsLike) {
        userTravelsLikeMapper.update(userTravelsLike);
    }

    @Override
    public void deleteById(Long id) {
        userTravelsLikeMapper.deleteById(id);
    }
}
